<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let str = "You seE whaT you believe!"
        function changeStr(str) {
            let arr = str.toLowerCase().split(" ")
            // console.log(arr);
            arr.forEach((item, index, array) => {
                arr[index] = item[0].toUpperCase() + item.substring(1, item.length);
            });
            return arr.join(" ")
        }
        console.log(changeStr(str)) //You See What You Believe!ascript
    </script>
</body>

</html>